
<script type="text/javascript">
	$(function(){			   
		$("[type=button]").button();
		
		tinyMCE.init({
			mode : "textareas",
			theme : "advanced",
			plugins : "safari,style,layer,table,advlink,emotions,insertdatetime,preview,print,fullscreen,noneditable,wordcount,visualblocks",
	
			theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
			theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,|,insertdate,inserttime,|,forecolor,backcolor,|,print,|,ltr,rtl,|,fullscreen",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "left",
			theme_advanced_statusbar_location : "bottom",
			theme_advanced_resizing : false,
			noneditable_leave_contenteditable : true,
			content_css : "js/tinymce/examples/css/content.css",
			setup : function(ed) { 
				ed.onPaste.add(function(ed, e, o) { 
					tinymce.dom.Event.cancel (e); 
				}); 
			}
		});
	})	
	
	
	function submitTrabalho(){
		
		var valor = tinyMCE.get('textoInfo').getContent();
	
		$('#formTxt').ajaxForm({
			dataType: 'json',
			data:{ 
				descricao:valor
			},
			success: function(responseText, statusText) {
				$html = $("#conteudo_infografico").html();
				$("#conteudo_infografico").html(responseText.link+" "+$html);
				$( ".draggable" ).draggable({ containment: "#conteudo_infografico", scroll: true });
				$(".txt").resizable();
				$('html, body').animate({
					scrollTop: $("#menus").offset().top
				}, 500);
				fechar();
			},
			resetForm: true
		}).submit();
	}
	
	function fechar(){		
		$('#texto_info').hide();
		$("#content").css("height","850px");
	}
	
</script>


<div id='texto_info' title='Enviar Mensagens' style='text-align:center;display:none;'>

    <br /><br />
    <span id="title">Digite seu Texto:</span>
    <br /><br />
    
    <div style="position:relative;margin-left:auto;margin-right:auto;width:650px;text-align:center;">
    	<form method="post" action="actions/infograficoAction.php" id="formTxt">
        <input type="hidden" value="texto" id="oper" name="oper" />
        
        <input type="hidden" id="id" name="id" />
        
        <textarea id="textoInfo" name="textoInfo" rows="3" cols="20" style="width:670px;height:280px;"></textarea><br/><br/>
        <input type="button" value="Enviar" onclick="submitTrabalho();"/>
        <input type="button" value="Fechar" onClick="fechar()"/>
        </form>
    </div>
</div>

<br /><br />